var path = require("path");

var basename = path.basename("b/aa/")

var extname = path.extname("b/aa.txt")

var result = [
    ".",
    "a/a.txt",
    "a/b",
    "a/b//",
    "a",
    "a.txt",
    "a/",
    "a.b/",
    '/foo/bar//baz//asdf//quux.html'
].map(e => path.basename(e));

console.log(result);

path.dirname

// console.log(process.env, process.platform);